package com.itheima.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping(value = "/myTest",name = "security注解配置测试" )
public class MyTestController {

    @RequestMapping(value = "/addTest.do")
    @PreAuthorize("hasRole('ROLE_ADD')")
    public String addTest(){
        System.out.println("add访问到了");

        //重定向
        return "redirect:/hello.html";
    }
}
